package io.github.soiff.mdoc.holder;

import java.io.Serializable;

/**
 * Created by zhangh on 10/25/2016.
 *
 * @author : zhangh@dtdream.com
 * @version : 1.0.0
 * @since : 1.8
 */
@SuppressWarnings({"unused", "WeakerAccess"})
public class Primitive implements Serializable {
    private static final long serialVersionUID = 0L;
    private static final Object NONE = new Object();
    private static final String EMPTY = "";

    private String name = EMPTY;
    private String type;
    private Object defaultValue = NONE;
    private boolean nullable = false;
    private String comment = EMPTY;

    public Primitive() {
    }

    public Primitive(String name, String type, Object defaultValue, boolean nullable, String comment) {
        this.name = name;
        this.type = type;
        this.defaultValue = defaultValue;
        this.nullable = nullable;
        this.comment = comment;
    }

    public Primitive(String type) {
        this.type = type;
    }

    public Primitive(String name, String type) {
        this.name = name;
        this.type = type;
    }

    public String getName() {return name;}
    public String getType() {return type;}
    public Object getDefaultValue() {return defaultValue;}
    public boolean isNullable() {return nullable;}
    public String getComment() {return comment;}

    public void setName(String name) {this.name = name;}
    public void setType(String type) {this.type = type;}
    public void setDefaultValue(Object defaultValue) {this.defaultValue = defaultValue;}
    public void setNullable(boolean nullable) {this.nullable = nullable;}
    public void setComment(String comment) {this.comment = comment;}
}
